{  Statement: http://acmp.ru/?main=task&id_task=381
   Verdict: Accepted
}
uses
  SysUtils, Math;

type
  point = record
    i,j:longint;
  end;

var
  i,j,n,h,t,cur,x,y:longint;
  a,v,r:array[0..260,0..260] of boolean;
  q:array[0..62510,1..2] of longint;
  b:array[0..260,0..260] of longint;
  p,xx:point;
  ch:char;

function check():boolean;
begin
result := b[xx.i][xx.j] = -1;
end;

procedure put(x,y:longint);
begin
if (not a[x][y]) or (x < 1) or (y < 1) or (x > n) or (y > n) or v[x][y] then exit;
inc(t);
q[t][1] := x;
q[t][2] := y;
v[x][y] := true;
b[x][y] := cur;
end;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(n);
fillchar(a,sizeof(a),true);
fillchar(v,sizeof(v),0);
fillchar(b,sizeof(b),-1);
for i:=1 to n do begin
  for j:=1 to n do begin
    read(ch);
    if ch = 'O' then a[i][j] := false else
    if ch = '@' then begin
      p.i := i;
      p.j := j;
    end else
    if ch = 'X' then begin
      xx.i := i;
      xx.j := j;
    end;
  end;
  readln;
end;
h:=1;
t:=1;
q[1][1] := p.i;
q[1][2] := p.j;
b[p.i][p.j] := 0;
v[p.i][p.j] := true;
while check() and (h <= t) do begin
  x := q[h][1];
  y := q[h][2];
  cur := b[x][y];
  inc(cur);
  put(x-1,y);
  put(x,y-1);
  put(x,y+1);
  put(x+1,y);
  inc(h);
end;
if check() then write('No') else begin
    writeln('Yes');
  fillchar(r,sizeof(r),0);
  x := xx.i;
  y := xx.j;
  cur := b[x][y] - 1;
  while cur >= 0 do begin
    r[x][y] := true;
    if b[x - 1][y] = cur then dec(x) else
    if b[x][y - 1] = cur then dec(y) else
    if b[x][y + 1] = cur then inc(y) else inc(x);
    dec(cur);
  end;
  for i:=1 to n do begin
    for j:=1 to n do begin
      if not a[i][j] then write('O') else
      if r[i][j] then write('+') else
      if (i = p.i) and (j = p.j) then write('@') else write('.');
    end;
    writeln;
  end;
end;
end.